<div>
    <form id="<?= $this->form->getId() ?>" action="<?= $this->form->getAction() ?>" method="post">

        <? foreach ($this->form as $element): ?>
            <?= $element ?>
        <? endforeach ?>

        <div>
            <table class="table table-bordered table-striped" style="width: 400px;">
                <thead>
                    <tr>
                        <th>Descrição</th>
                        <th style="text-align: center;">Edição <input type="checkbox" id="checkAllEd"/></th>
                        <th style="text-align: center;">Consulta<input type="checkbox" id="checkAllCon"/></th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($this->modulos as $modulo): ?>
                        <?php 
                            if(!isset($this->perfis)){
                                $edicao = '';
                                $consulta = '';
                            }
                        ?>
                        <tr>
                            <td><?= $modulo['nome'] ?></td>
                            <td style="text-align: center;">
                                <input type="checkbox" name="modulo_ed[]" class="checkAllEd" value="<?= $modulo['codigo'] ?>" <?= $edicao ?>/>
                            </td>
                            <td style="text-align: center;">
                                <input type="checkbox" name="modulo_con[]" class="checkAllCon" value="<?= $modulo['codigo'] ?>" <?= $consulta ?>/>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </div>

    </form>
</div>
